﻿@using BookShop.Library.Constant
@using BookShop.DTO
<!DOCTYPE html>
<!-- 
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.2.0
Version: 3.4
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: support@keenthemes.com
Follow: www.twitter.com/keenthemes
Like: www.facebook.com/keenthemes
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
License: You must have a valid license purchased only from themeforest (the above link) in order to legally use the theme for your project.
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->'

<html lang="en">
<!--<![endif]-->

<!-- Head BEGIN -->
<head>
    <meta charset="utf-8">
    <title>@ViewBag.Title</title>

    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    <link rel="shortcut icon" href="favicon.ico">

    <!-- Fonts START -->
    <link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700|PT+Sans+Narrow|Source+Sans+Pro:200,300,400,600,700,900&amp;subset=all" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900&amp;subset=all" rel="stylesheet" type="text/css">
    <!--- fonts for slider on the index page -->
    <!-- Fonts END -->

    <!-- Global styles START -->
    <link href="~/Content/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link href="~/Content/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <!-- Global styles END -->

    <!-- Theme styles START -->
    <link href="~/Content/assets/global/css/components.css" rel="stylesheet">
    <link href="~/Content/assets/frontend/layout/css/style.css" rel="stylesheet">
    <link href="~/Content/assets/frontend/pages/css/style-shop.css" rel="stylesheet" type="text/css">
    <link href="~/Content/assets/frontend/pages/css/style-layer-slider.css" rel="stylesheet">
    <link href="~/Content/assets/frontend/layout/css/style-responsive.css" rel="stylesheet">
    <link href="~/Content/assets/frontend/layout/css/themes/red.css" rel="stylesheet" id="style-color">
    <link href="~/Content/custom.css" rel="stylesheet">
    <!-- Theme styles END -->

    <!-- Page level START -->
    @RenderSection("Css", false)
    <!-- Page level END -->
</head>
<!-- Head END -->

<!-- Body BEGIN -->
<body class="ecommerce">

    <!-- BEGIN TOP BAR -->
    <div class="pre-header">
        <div class="container">
            <div class="row">
                <!-- BEGIN TOP BAR LEFT PART -->
                <div class="col-md-6 col-sm-6 additional-shop-info">
                    <ul class="list-unstyled list-inline">
                        <li><i class="fa fa-phone"></i><span>0974 336 764</span></li>
                    </ul>
                </div>
                <!-- END TOP BAR LEFT PART -->
                <!-- BEGIN TOP BAR MENU -->
                <div class="col-md-6 col-sm-6 additional-nav">
                    <ul class="list-unstyled list-inline pull-right">
                        @if (Session[SessionKey.Customer] == null)
                        {
                            <li><a href="@Url.Action("Login", "Account", new { previousUrl = Request.RawUrl })">Đăng nhập</a></li>
                            <li><a href="@Url.Action("SignUp", "Account")">Đăng ký</a></li>
                        }
                        else
                        {
                            var customerSession = (Customer)Session[SessionKey.Customer];
                            <li>Xin chào: @customerSession.FullName</li>
                            <li><a href="@Url.Action("Index", "Account")">Tài khoản</a></li>
                            <li><a href="@Url.Action("LogOut", "Account")">Đăng xuất</a></li>
                        }
                        <li><a href="@Url.Action("CheckOut", "Cart")">Thanh toán</a></li>
                    </ul>
                </div>
                <!-- END TOP BAR MENU -->
            </div>
        </div>
    </div>
    <!-- END TOP BAR -->

    <!-- BEGIN HEADER -->
    <div class="header">
        <div class="container">
            <a class="site-logo" href="#">
                @*<img src="~/Content/assets/frontend/layout/img/logos/logo-shop-red.png" alt="Metronic Shop UI">*@</a>

            <a href="#" class="mobi-toggler"><i class="fa fa-bars"></i></a>

            <!-- BEGIN CART -->
            @{
                var cartItemList = (List<CartItem>)Session[SessionKey.ShoppingCart] ?? new List<CartItem>();
            }
            <div class="top-cart-block">
                <div class="top-cart-info">
                    <a href="#" class="top-cart-info-count">@cartItemList.Count sản phẩm</a>
                    <a href="#" class="top-cart-info-value">@cartItemList.Select(a => new { TotalPrice = a.Quantity * a.UnitPrice }).Sum(a => a.TotalPrice) (Đ)</a>
                </div>
                <i class="fa fa-shopping-cart"></i>
                <div class="top-cart-content-wrapper">
                    <div class="top-cart-content">
                        <ul class="scroller" style="height: 250px;">
                            @if (cartItemList.Count > 0)
                            {
                                foreach (var cartItem in cartItemList)
                                {
                                <li>
                                    <a href="javascript:;">
                                        <img src="@HTN.Library.Utility.UrlCombine(BookShop.Library.Common.CommonFunction.GetConfigValue("SiteUrl"), cartItem.Book.PictureUrl)" alt="@cartItem.Book.Title" width="37" height="34"></a>
                                    <span class="cart-content-count">x @cartItem.Quantity</span>
                                    <strong><a href="@Url.Action("Detail", "Book", new { bookId = cartItem.Book.Id })">@cartItem.Book.Title</a></strong>
                                    <em>@cartItem.UnitPrice</em>
                                    <a href="javascript:deleteCartItem('@cartItem.Id');" class="del-goods">&nbsp;</a>
                                </li>
                                }
                            }
                            else
                            {
                                <li>Giỏ hàng rỗng.</li>
                            }
                        </ul>
                        <div class="text-right">
                            <a href="@Url.Action("ShoppingCart", "Cart")" class="btn btn-default">Giỏ hàng</a>
                            @if (cartItemList.Count > 0)
                            {
                                <a href="@Url.Action("CheckOut", "Cart")" class="btn btn-primary">Thanh toán</a>
                            }
                        </div>
                    </div>
                </div>
            </div>
            <!--END CART -->

            <!-- BEGIN NAVIGATION -->
            <div class="header-navigation">
                <ul>
                    <li><a href="@Url.Action("Index", "Home")">Trang chủ</a></li>
                    <li class="dropdown dropdown-megamenu">
                        <a href="@Url.Action("ProductPage", "Home")" class="dropdown-toggle" data-toggle="dropdown" onclick="window.location.href = this.href;">Sản phẩm</a>
                        <ul class="dropdown-menu">
                            <li>
                                <div class="header-navigation-content">
                                    <div class="row">
                                        <div class="col-md-4 header-navigation-col">
                                            <h4>Thể loại</h4>
                                            <ul id="categoryNav"></ul>
                                        </div>
                                        <div class="col-md-4 header-navigation-col">
                                            <h4>Tác giả</h4>
                                            <ul id="authorNav"></ul>
                                        </div>
                                        <div class="col-md-4 header-navigation-col">
                                            <h4>Nhà xuất bản</h4>
                                            <ul id="publisherNav"></ul>
                                        </div>
                                    </div>
                                </div>
                            </li>
                        </ul>
                    </li>
                    <li><a href="@Url.Action("SalePage", "Home")">Giảm giá</a></li>
                    <li><a href="@Url.Action("About", "Home")">Giới thiệu</a></li>
                    <li><a href="@Url.Action("ContactUs", "Home")">Liên hệ</a></li>

                    <!-- BEGIN TOP SEARCH -->
                    <li class="menu-search">
                        <span class="sep"></span>
                        <i class="fa fa-search search-btn"></i>
                        <div class="search-box">
                            <form action="@Url.Action("ProductPage", "Home")" method="POST">
                                <div class="input-group">
                                    <input type="text" placeholder="Search" name="title" id="title" class="form-control">
                                    <span class="input-group-btn">
                                        <button class="btn btn-primary" type="submit">Tìm kiếm</button>
                                    </span>
                                </div>
                            </form>
                        </div>
                    </li>
                    <!-- END TOP SEARCH -->
                </ul>
            </div>
            <!-- END NAVIGATION -->
        </div>
    </div>
    <!-- Header END -->

    @RenderSection("Slider", false)

    <div class="main">
        <div class="container">
            @RenderBody()
        </div>
    </div>

    <!-- BEGIN STEPS -->
    <div class="steps-block steps-block-red">
        <div class="container">
            <div class="row">
                <div class="col-md-2"></div>
                <div class="col-md-4 steps-block-col">
                    <i class="fa fa-truck"></i>
                    <div>
                        <h2>Free Shipping</h2>
                        <em>Miễn phí vận chuyển</em>
                    </div>
                    <span>&nbsp;</span>
                </div>
                <div class="col-md-4 steps-block-col">
                    <i class="fa fa-phone"></i>
                    <div>
                        <h2>0974 336 764</h2>
                        <em>Dịch vụ khách hàng 24/7</em>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- END STEPS -->

    <!-- BEGIN PRE-FOOTER -->
    <div class="pre-footer">
        <div class="container">
            <div class="row">
                <!-- BEGIN BOTTOM ABOUT BLOCK -->
                <div class="col-md-4 col-sm-6 pre-footer-col">
                    <h2>Giới thiệu</h2>
                    <p>Với mục tiêu tạo ra những trải nghiệm mua sắm trực tuyến tuyệt vời, website của chúng tôi luôn nỗ lực không ngừng nhằm nâng cao chất lượng dịch vụ. </p>
                </div>
                <!-- END BOTTOM ABOUT BLOCK -->
                <!-- BEGIN BOTTOM INFO BLOCK -->
                <div class="col-md-4 col-sm-6 pre-footer-col">
                    <h2>Thông tin</h2>
                    <ul class="list-unstyled">
                        <li><i class="fa fa-angle-right"></i><a href="@Url.Action("ContactUs", "Home")">Liên hệ</a></li>
                        @*<li><i class="fa fa-angle-right"></i><a href="#">Thông tin vận chuyển</a></li>
                        <li><i class="fa fa-angle-right"></i><a href="#">Dịch vụ khách hàng</a></li>
                        <li><i class="fa fa-angle-right"></i><a href="#">Phương thức thanh toán</a></li>*@
                    </ul>
                </div>
                <!-- END INFO BLOCK -->

                <!-- BEGIN BOTTOM CONTACTS -->
                <div class="col-md-4 col-sm-6 pre-footer-col">
                    <h2>Liên hệ</h2>
                    <address class="margin-bottom-40">
                        Trường Đại học Bách Khoa Hà Nội<br />
                        Số 1, Đại Cồ Việt, Hai Bà Trưng<br>
                        Hà Nội, Việt Nam<br>
                        Phone: 0974336764<br>
                        Email: <a href="mailto:milkriver311@gmail.com">milkriver311@gmail.com</a><br>
                        Skype: <a href="skype:milkriver311?chat">milkriver311</a>
                    </address>
                </div>
                <!-- END BOTTOM CONTACTS -->
            </div>
            <hr>
            <div class="row">
                <!-- BEGIN SOCIAL ICONS -->
                <div class="col-md-6 col-sm-6">
                    <ul class="social-icons">
                        <li><a class="facebook" data-original-title="facebook" href="https://www.facebook.com/silver.river.52"></a></li>
                        <li><a class="googleplus" data-original-title="googleplus" href="https://plus.google.com/u/1/101296049685617402624/posts"></a></li>
                        <li><a class="youtube" data-original-title="youtube" href="https://www.youtube.com/channel/UCol2WYOsfX6RvuRsumYcyEw"></a></li>
                        <li><a class="skype" data-original-title="skype" href="skype:milkriver311?chat"></a></li>
                    </ul>
                </div>
                <!-- END SOCIAL ICONS -->
            </div>
        </div>
    </div>
    <!-- END PRE-FOOTER -->

    <!-- BEGIN FOOTER -->
    @*<div class="footer">
        <div class="container">
            <div class="row">
                <!-- BEGIN COPYRIGHT -->
                <div class="col-md-6 col-sm-6 padding-top-10">
                    2014 © Metronic Shop UI. ALL Rights Reserved. 
         
                </div>
                <!-- END COPYRIGHT -->
            </div>
        </div>
    </div>*@
    <!-- END FOOTER -->

    <!-- Load javascripts at bottom, this will reduce page load time -->
    <!-- BEGIN CORE PLUGINS (REQUIRED FOR ALL PAGES) -->
    <!--[if lt IE 9]>
    <script src="~/Content/assets/global/plugins/respond.min.js"></script>  
    <![endif]-->
    <script src="~/Content/assets/global/plugins/jquery.min.js" type="text/javascript"></script>
    <script src="~/Content/assets/global/plugins/jquery-migrate.min.js" type="text/javascript"></script>
    <script src="~/Content/assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="~/Content/assets/frontend/layout/scripts/back-to-top.js" type="text/javascript"></script>
    <script src="~/Content/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
    <script src="~/Content/custom.js" type="text/javascript"></script>
    <!-- END CORE PLUGINS -->
    <script src="~/Content/assets/frontend/layout/scripts/layout.js" type="text/javascript"></script>
    <script type="text/javascript">
        jQuery(document).ready(function () {
            Layout.init();
            getCategories(5);
            getPublishers(5);
            getAuthors(5);
        });
        function getCategories(count) {
            $("#categoryNav").empty();
            $.ajax({
                type: 'POST',
                url: '@Url.Action("GetAllCategory", "Home")',
                data: { count: count},
                success: function (categories) {
                    $.each(categories, function (i, category) {
                        $("#categoryNav").append('<li><a href="/Home/ProductPage?categoryId=' + category.Id + '">' + category.Name + '</a></li>');
                    });
                    $("#categoryNav").append('<li><a href="/Home/AllCategory" style="font-weight: 600;">Tất cả các Thể loại</a></li>');
                },
                error: function () {
                }
            });
            return false;
        }
        function getPublishers(count) {
            $("#publisherNav").empty();
            $.ajax({
                type: 'POST',
                url: '@Url.Action("GetAllPublisher", "Home")',
                data: { count: count },
                success: function (publishers) {
                    $.each(publishers, function (i, publisher) {
                        $("#publisherNav").append('<li><a href="/Home/ProductPage?publisherId=' + publisher.Id + '">' + publisher.Name + '</a></li>');
                    });
                    $("#publisherNav").append('<li><a href="/Home/AllPublisher" style="font-weight: 600;">Tất cả các Nhà xuất bản</a></li>');
                },
                error: function () {
                }
            });
            return false;
        }
        function getAuthors(count) {
            $("#authorNav").empty();
            $.ajax({
                type: 'POST',
                url: '@Url.Action("GetAllAuthor", "Home")',
                data: { count: count },
                success: function (authors) {
                    $.each(authors, function (i, author) {
                        $("#authorNav").append('<li><a href="/Home/ProductPage?authorId=' + author.Id + '">' + author.Name + '</a></li>');
                    });
                    $("#authorNav").append('<li><a href="/Home/AllAuthor" style="font-weight: 600;">Tất cả các Tác giả</a></li>');
                },
                error: function () {
                }
            });
            return false;
        }
    </script>
    <!-- BEGIN PAGE LEVEL PLUGINS -->
    @RenderSection("Javascript", false)
    <!-- END PAGE LEVEL PLUGINS -->
</body>
<!-- END BODY -->
</html>
